use rbatis::{crud};
use rbatis::error::Error;
use rbatis::rbatis::Rbatis;
use rbatis::rbdc::decimal::Decimal;

// #[crud_table(table_name:"ts_areas"|table_columns:"area_code,area_name,area_pinyin,area_type,code,ctime,id,is_new,latitude,longitude,max_drugstore_area_id,parent_id,path,sort,weather_citycode")]
#[derive(Debug, Clone, Default, serde::Deserialize, serde::Serialize)]
pub struct TsAreas {
    pub area_code: Option<i32>,
    pub area_name: Option<String>,
    pub area_pinyin: Option<String>,
    pub area_type: Option<i8>,
    pub code: Option<String>,
    pub ctime: Option<i32>,
    pub id: Option<i32>,
    pub is_new: Option<i8>,
    pub latitude: Option<Decimal>,
    pub longitude: Option<Decimal>,
    pub max_drugstore_area_id: Option<i32>,
    pub parent_id: Option<i32>,
    pub path: Option<String>,
    pub sort: Option<i32>,
    pub weather_citycode: Option<i32>,
}
crud!(TsAreas {});


#[derive(Debug, serde::Deserialize, serde::Serialize)]
pub struct AreaDto {
    pub id: Option<i32>,
    pub parent_code: Option<i32>,
    pub name: Option<String>,
    pub code: Option<i32>,
    pub r#type: Option<i32>,
    pub is_new: Option<i32>,
    pub province_code: Option<i32>,
    pub province_name: Option<String>,
    pub city_code: Option<i32>,
    pub city_name: Option<String>,
    pub district_code: Option<i32>,
    pub district_name: Option<String>,
    pub street_code: Option<i32>,
    pub street_name: Option<String>,
}